import request from '@/utils/request'

// 查询赞助列表
export function listSponsor(query) {
  return request({
    url: '/sponsor/list',
    method: 'get',
    params: query
  })
}

// 查询赞助详细
export function getSponsor(sponsorId) {
  return request({
    url: '/sponsor/' + sponsorId,
    method: 'get'
  })
}

// 查询上一条赞助列表
export function getUpSponsor(sponsorId) {
  return request({
    url: '/sponsor/getUpSponsor/' + sponsorId,
    method: 'get'
  })
}

// 查询下一条赞助列表
export function getNextSponsor(sponsorId) {
  return request({
    url: '/sponsor/getNextSponsor/' + sponsorId,
    method: 'get'
  })
}

export function updateSponsorClick(data) {
  return request({
    url: '/sponsor/updateClick',
    method: 'put',
    data: data
  })
}

// 新增赞助
export function addSponsor(data) {
  return request({
    url: '/sponsor',
    method: 'post',
    data: data
  })
}

// 修改赞助
export function updateSponsor(data) {
  return request({
    url: '/sponsor',
    method: 'put',
    data: data
  })
}

// 删除赞助
export function delSponsor(sponsorId) {
  return request({
    url: '/sponsor/' + sponsorId,
    method: 'delete'
  })
}

// 导出赞助
export function exportSponsor(query) {
  return request({
    url: '/sponsor/export',
    method: 'get',
    params: query
  })
}
